package com.lanou.musicproject.tools;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

/**
 * Created by penglei on 15/9/24.
 * 将汉字转换成utf-8格式的类,与方法**/
public class FormatCodeUtil {
    public static String codingFormat(String str) {

        try {
            String utfStr = URLEncoder.encode(str, "utf-8");
            return utfStr;
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return "";
    }
}